package util;

import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;

public class ExecutionTime {

	private long msBegin, msEnd, msTime, currentTime;

	GregorianCalendar calendar;
	SimpleDateFormat formatDate;

	public void start() {
		msTime = 0;
		msBegin = System.currentTimeMillis();
	}

	public void stop() {
		msEnd = System.currentTimeMillis();
		msTime = msEnd - msBegin;
	}

	public long getTime() {
		return this.msTime;
	}

	public long stime() {
		return Math.round(msTime / 1000.);
	}

	public long mtime() {
		return Math.round(msTime / 60000.);
	}

	public long htime() {
		return Math.round(msTime / 3600000.);
	}

	public long resume() {
		currentTime = System.currentTimeMillis();
		return currentTime;
	}
	
	public long getBeginTime() {
		return this.msBegin;
	}
	
	public long getEndTime() {
		return this.msEnd;
	}
}
